package com.qijian.maindata.domain.query;


import com.baomidou.mybatisplus.annotation.TableName;
import com.qijian.common.utils.mybatis.WhereType;
import com.qijian.common.utils.mybatis.WhereTypeEnum;
import lombok.Data;
import lombok.ToString;

import java.util.List;


/**
 * 【请填写功能名称】对象 查询条件类
 *
 * @author qijian
 * @date 2023-11-15
 */

@Data
@ToString
@TableName("main_bom_craft_file")
public class BomCraftFileQuery {

    @WhereType(filed = "bom_id")
    private Long bomId;
    @WhereType(filed = "is_enable")
    private Boolean isEnable;

    @WhereType(filed = "id")
    private Long id;


    @WhereType(filed = "create_user_id")
    private Long createByUserId;

    @WhereType(fields={"main_item.item_code","main_item.item_name","tool_storage.name","main_bom_craft_file.create_by"},type = WhereTypeEnum.LIKE)
    private String condition;

    @WhereType(filed = "item_code",tableName = "main_item",type = WhereTypeEnum.LIKE)
    private String itemCode;

    @WhereType(filed = "item_name",tableName = "main_item",type = WhereTypeEnum.LIKE)
    private String itemName;

    @WhereType(filed = "name",tableName = "tool_storage",type = WhereTypeEnum.LIKE)
    private String fileName;

    @WhereType(filed = "create_by",type = WhereTypeEnum.LIKE)
    private String createBy;

//    @WhereType(func = "exists(select 1 from main_project p where p.project_no like concat('%',{1},'%') and p.bom_id = main_bom_craft_file.bom_id and p.is_del=0)")
    private String projectNo;

//    @WhereType(func = "exists(select 1 from main_project p where p.machine_no like concat('%',{1},'%') and p.bom_id = main_bom_craft_file.bom_id and p.is_del=0)")
    private String machineNo;


    @WhereType(filed = "project_machine_no",type = WhereTypeEnum.LIKE)
    private String beginChangeNo;

//    @WhereType(func = " (exists (select 1 from sys_sign_notification sn left join sys_sign_notification_node ssn on sn.id = ssn.main_id and sn.is_del=0 " +
//            "           where main_bom_craft_file.id = sn.source_id and sn.source_type='sign_bom_process_documents'" +
//            " and ssn.receiver_id={1} ) or main_bom_craft_file.create_user_id={1} ) ")
    private Long createOrSignUserId;

    private List<String> createTime;

}
